import request from '@/utils/request'
import { deletefn, deletefn1, get, get1 } from '@/utils/request'

// 企业入驻审批
export function getSettleInApprovalInfoBypaStatus(page, limit, paStatus) {
    return get('/api-user/tbEnter', {
      page,
      limit,
      paStatus
    })
}
// 企业入驻审批完  未退租
export function getFirmInfoBypaStatus(page, limit, paStatus, leaseStatus) {
  return get('/api-user/tbEnter/selectCui', {
    page,
    limit,
    paStatus,
    leaseStatus
  })
}
// 企业信息审批
export function getSettleInApprovalInfoByapproveStatus(current, size) {
  return get('/api-user/tbFirmMsg', {
    current,
    size
  })
}
// 企业信息审批详情
export function getFirmApprovalInfoById(id) {
  return get('/api-user/tbFirmMsg/selectIdAll', {
    id
  })
}
// 企业信息审批详情--该状态
// export function putFirmInfoByApproval(approveStatus, id, cid, opinion) {
//   return get1('/api-user/tbFirmMsg/updateApprove?approveStatus='+ approveStatus + '&id='+id + '&cid=' + cid + '&opinion=' + opinion)
// }
export function putFirmInfoByApproval(data) {
  return request({
    url: '/api-user/tbFirmMsg/updateApprove',
    method: 'put',
    data
  })
}

export function getSettleInApprovalInfoById(id) {
  return get('/api-user/tbEnter', {
    id
  })
}

export function putSettleInInfoByApproval(data) {
  return request({
    url: '/api-user/tbEnter',
    method: 'put',
    data
  })
}

//企业信息管理
// 企业合同
export function getContractInfoById(fid) {
  return get1('/api-user/tbContract/selectIdList/' + fid)
}

export function putEnterpriseInfoById(data) {
  return request({
    url: '/api-user/tbFirm',
    method: 'put',
    data
  })
}

// 退租
export function getRentRefundApprovalInfo(page, limit, leaseStatus) {
  return get('/api-user/tbEnter', {
    page,
    limit,
    leaseStatus
  })
}